home *** CD-ROM | disk | FTP | other *** search
/ Secrets of Stargate / STARGATE.iso / mac / STARGATE (5MB Macintosh) / STARGATE (5MB Macintosh).DXR / 00002_Prod Still Scripts.ls < prev    next >
Encoding:
Text File  |  1994-10-19  |  7.7 KB  |  307 lines

  1. on psSubCatClick
  2.   if voidp(sN) then
  3.     set sN to the clickOn
  4.   end if
  5.   hiliteAnim(sN, "PS_")
  6.   set theLine to sN - 11
  7.   if the frameLabel contains "PS Individuals2" then
  8.     set theLine to theLine + 14
  9.   end if
  10.   LoadPSSubCat(theLine)
  11. end
  12.  
  13. on psCatClick sN, theCat
  14.   if voidp(sN) then
  15.     set sN to the clickOn
  16.   end if
  17.   hiliteAnim(sN, "PS_")
  18.   set the visible of sprite 31 to 0
  19.   if theCat = "Custom Marked List" then
  20.     showProdStills("Marked")
  21.   else
  22.     LoadPSCat(theCat)
  23.   end if
  24. end
  25.  
  26. on LoadPSCat theCat
  27.   global gResourcePath, gPSCategory, gPSSubCats, gPSIndivid2Flag
  28.   spinCursor()
  29.   set gPSCategory to theCat
  30.   if gPSCategory = "Marked" then
  31.     LinkTo("PS Menu")
  32.   else
  33.     set theLine to LineOffset(gPSCategory, field "PSDATA_C")
  34.     set the itemDelimiter to "|"
  35.     set gPSSubCats to item theLine of field "PSDATA_D"
  36.     put gPSSubCats into field "PS SubCats"
  37.     set the itemDelimiter to ","
  38.     if gPSIndivid2Flag = 1 then
  39.       LinkTo("PS " & theCat & "2")
  40.       set gPSIndivid2Flag to 0
  41.     else
  42.       LinkTo("PS " & theCat)
  43.     end if
  44.   end if
  45. end
  46.  
  47. on LinkBackToPSCat
  48.   global gPSCategory
  49.   LoadPSCat(gPSCategory)
  50. end
  51.  
  52. on LoadPSSubCat theSprite
  53.   global gPSCategory, gPSSubCats
  54.   spinCursor()
  55.   set theChoice to line theSprite of gPSSubCats
  56.   set theSubCat to gPSCategory & ":" & theChoice
  57.   set theLine to LineOffset(theSubCat, field "PSDATA_R1")
  58.   showProdStills(theLine)
  59. end
  60.  
  61. on showProdStills theLine, captionText
  62.   global gPSState, gMarkedList, gPSRecords, gPSViewedHere, gLinkBack, gPSCaption, gOnPC, gPSCategory
  63.   spinCursor()
  64.   if (theLine = EMPTY) or voidp(theLine) then
  65.     set theLine to 1
  66.   end if
  67.   set gPSState to 1
  68.   if gOnPC then
  69.     stopAiff()
  70.   end if
  71.   set theFrame to "PS BG"
  72.   if theLine = "Marked" then
  73.     if gMarkedList = "[]" then
  74.       resetCursor()
  75.       exit
  76.     else
  77.       set gPSRecords to gMarkedList
  78.     end if
  79.     set gPSCaption to "User Marked List"
  80.     set s to count(gPSRecords)
  81.     set gPSViewedHere to s && s
  82.     set gPSCategory to "Marked"
  83.   else
  84.     if theLine = "Links" then
  85.       set theFrame to "PS Links"
  86.       set gPSCaption to captionText
  87.     else
  88.       loadPSData(theLine)
  89.       set theCat to line theLine of field "PSDATA_R1"
  90.       set c to offset(":", theCat)
  91.       put " " after char c of theCat
  92.       set gPSCaption to theCat
  93.     end if
  94.   end if
  95.   spinCursor()
  96.   put gPSCaption into field "PS Cat"
  97.   set the foreColor of cast "PS Cat" to 200
  98.   LinkTo(theFrame)
  99.   if gOnPC then
  100.     pause()
  101.   end if
  102.   set the visible of sprite 31 to 0
  103.   spinCursor()
  104.   updatePS(1)
  105.   if gOnPC then
  106.     continue()
  107.   end if
  108.   resetCursor()
  109. end
  110.  
  111. on loadPSData theLine
  112.   global gPSUserViewed, gPSViewedHere, gPSRecords
  113.   spinCursor()
  114.   set theseRecs to line theLine of field "PSDATA_R2"
  115.   delete item 1 of theseRecs
  116.   set theseRecs to value(theseRecs)
  117.   set weightList to []
  118.   set newCats to []
  119.   set oldCats to []
  120.   spinCursor()
  121.   set numRecs to count(theseRecs)
  122.   repeat with z = 1 to numRecs
  123.     if (z mod 20) = 0 then
  124.       spinCursor()
  125.     end if
  126.     set thisCat to getAt(theseRecs, z)
  127.     set a to getOne(gPSUserViewed, thisCat)
  128.     if a > 0 then
  129.       add(weightList, thisCat)
  130.       next repeat
  131.     end if
  132.     add(newCats, thisCat)
  133.   end repeat
  134.   spinCursor()
  135.   set numSeen to count(weightList)
  136.   set numNew to count(newCats)
  137.   set gPSViewedHere to numSeen && numRecs
  138.   spinCursor()
  139.   if numSeen = 0 then
  140.     set gPSRecords to newCats
  141.   else
  142.     if numNew = 0 then
  143.       set gPSRecords to weightList
  144.     else
  145.       delete char 1 of newCats
  146.       delete char the number of chars in newCats of newCats
  147.       delete char 1 of weightList
  148.       delete char the number of chars in weightList of weightList
  149.       set newCats to newCats & ", "
  150.       set gPSRecords to value("[" & newCats & weightList & "]")
  151.     end if
  152.   end if
  153. end
  154.  
  155. on psSlideShow
  156.   global gSlideDelay
  157.   stopCursor()
  158.   set continue to 1
  159.   set firstClick to the clickLoc
  160.   set theDelay to 60 * integer(gSlideDelay)
  161.   if theDelay < 60 then
  162.     set theDelay to 60
  163.   end if
  164.   repeat while continue
  165.     nextPS()
  166.     updateStage()
  167.     idle()
  168.     repeat with z = 1 to theDelay
  169.       wait(1)
  170.       if (the mouseDown = 1) or (the clickLoc <> firstClick) then
  171.         set continue to 0
  172.         exit repeat
  173.       end if
  174.     end repeat
  175.     if continue <> 1 then
  176.       exit repeat
  177.     end if
  178.     idle()
  179.   end repeat
  180.   resetCursor()
  181.   startMouse()
  182. end
  183.  
  184. on nextPS
  185.   global gPSState, gPSRecords
  186.   set curLine to value(item 1 of gPSState)
  187.   set maxLine to count(gPSRecords)
  188.   if curLine = EMPTY then
  189.     set curLine to 1
  190.   else
  191.     if (curLine > maxLine) or (curLine = maxLine) or (maxLine = 0) then
  192.       if (maxLine = 1) or (maxLine = 0) then
  193.         LinkBackToPSCat()
  194.         resetCursor()
  195.         exit
  196.       else
  197.         set curLine to 1
  198.       end if
  199.     else
  200.       set curLine to curLine + 1
  201.     end if
  202.   end if
  203.   updatePS(curLine)
  204. end
  205.  
  206. on prevPS
  207.   global gPSState, gPSRecords
  208.   if the timer < 20 then
  209.     exit
  210.   end if
  211.   set curLine to value(item 1 of gPSState)
  212.   set maxLine to count(gPSRecords)
  213.   if curLine = EMPTY then
  214.     set curLine to 1
  215.   else
  216.     if (curLine = 1) or (maxLine = 0) then
  217.       if (maxLine = 1) or (maxLine = 0) then
  218.         LinkBackToPSCat()
  219.         resetCursor()
  220.         exit
  221.       else
  222.         set curLine to maxLine
  223.       end if
  224.     else
  225.       set curLine to curLine - 1
  226.     end if
  227.   end if
  228.   spinCursor()
  229.   updatePS(curLine)
  230.   resetCursor()
  231.   startMouse()
  232. end
  233.  
  234. on updatePS curLine
  235.   global gPSState, gPSRecords, gPSUserViewed, gPSViewedHere, gPSCaption
  236.   set the visible of sprite 35 to 0
  237.   set the visible of sprite 35 to 1
  238.   set recordNum to getAt(gPSRecords, curLine)
  239.   set the movieTime of sprite 31 to recordNum * 60
  240.   if getOne(gPSUserViewed, recordNum) = 0 then
  241.     add(gPSUserViewed, recordNum)
  242.     put word 1 of gPSViewedHere + 1 into word 1 of gPSViewedHere
  243.   end if
  244.   debug("R: " & recordNum)
  245.   put integer(curLine) into item 1 of gPSState
  246.   set isMarked to toggleMarked("Test", recordNum)
  247.   updateStage()
  248.   set the visible of sprite 31 to 1
  249.   updateStage()
  250.   set the movieTime of sprite 31 to recordNum * 60
  251.   set sbTxtHdr to field "PSDATA_0"
  252.   set numChunks to line 1 of sbTxtHdr
  253.   delete line 1 of sbTxtHdr
  254.   repeat with z = 1 to the number of lines in sbTxtHdr
  255.     set sRec to word 1 of line z of sbTxtHdr
  256.     set eRec to word 2 of line z of sbTxtHdr
  257.     if (recordNum >= sRec) and (recordNum <= eRec) then
  258.       exit repeat
  259.     end if
  260.   end repeat
  261.   set theLine to recordNum - sRec + 1
  262.   set theData to line theLine of field ("PSDATA_" & z)
  263.   set the itemDelimiter to "|"
  264.   set theBTS to item 3 of theData
  265.   set theMooV to item 4 of theData
  266.   set the itemDelimiter to ","
  267.   put gPSCaption && theBTS into field "PS Cat"
  268.   if the frameLabel <> "PS Links" then
  269.     set linkBackMsg to "LinkTo " & QUOTE & "PS BG" & QUOTE & RETURN & "UpdatePS " & curLine
  270.     updateLinkIcons(linkBackMsg, "PS_", 0, theMooV, 0, 0)
  271.   end if
  272. end
  273.  
  274. on toggleMarked state, theRecord
  275.   global gMarkedList, gPSState, gPSRecords, gOnPC, gResourcePath
  276.   set returnVal to state = "test"
  277.   set theRecord to getAt(gPSRecords, value(item 1 of gPSState))
  278.   set curLine to getOne(gMarkedList, theRecord)
  279.   if gOnPC then
  280.     set thePath to gResourcePath & "SCRNPICT/"
  281.   else
  282.     set thePath to "STARGATE:RESOURCE:SCRNPICT:"
  283.   end if
  284.   if not (returnVal = 1) then
  285.     set state to not (the hilite of cast "Marked")
  286.     put curLine
  287.     if (state = 0) and (curLine > 0) then
  288.       deleteAt(gMarkedList, curLine)
  289.     else
  290.       if (state = 1) and (curLine = 0) then
  291.         add(gMarkedList, theRecord)
  292.       end if
  293.     end if
  294.     set isMarked to state
  295.   else
  296.     set isMarked to curLine <> 0
  297.   end if
  298.   set the hilite of cast "Marked" to isMarked
  299.   if isMarked then
  300.     set the fileName of cast "PS_MARKG.PIC" to thePath & "PS_MARKB.PIC"
  301.   else
  302.     set the fileName of cast "PS_MARKG.PIC" to thePath & "PS_MARKG.PIC"
  303.   end if
  304.   set the hilite of cast "Marked" to isMarked
  305.   return isMarked
  306. end
  307.